package com.leps.nq.bu.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.leps.nq.bu.entity.BuArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leps.nq.bu.vo.AreaQueryModel;
import com.leps.nq.bu.vo.AreaVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 区块表 Mapper 接口
 * </p>
 *
 * @author hex
 * @since 2022-05-22
 */
@Mapper
public interface BuAreaMapper extends BaseMapper<BuArea> {

    List<BuArea> selectAreaListByUserId(Long userId);

    int updateCustName(String newCustName, int custId);

    Page<AreaVo> selelctByQueryModel(Page<AreaVo> page, @Param("queryModel") AreaQueryModel queryModel);

    int updateRedundantField(BuArea area);

    List<Integer> selectAreaIdListByCustId(Collection<Integer> custIds);

    List<BuArea> selectListByCustIdAndUserId(@Param("custId") Integer custId, @Param("userId") long userId);


}
